<!DOCTYPE html>
<html>
<head>
    <title>外带列表</title>
</head>
<body class="layui-layout-body">
    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div class="body_right">
            <h4 class="nav_title">外带记录</h4>
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                <ul class="layui-tab-title">
                    <li lay-id="SEAL_LIST">印章列表</li>
                    <li lay-id="APPLY_LIST">申请记录</li>
                    <li lay-id="APPROVE_LIST">授权记录</li>
                    <li lay-id="TAKE_LIST" class="layui-this">外带记录</li>
                </ul>
                <div class="layui-tab-content" style="height: 100px;">
                    <div class="layui-tab-item layui-show">
                        <div class="layui-row">
					        <form  action="/custos/list.htm" class="layui-form no_bordertop layui-col-md12 x-so">
					          <div class="layui-inline">
			                        <label class="layui-form-label width60">印章名称</label>
			                        <div class="layui-input-inline width150">
			                            <input type="text" class="layui-input" name="devicesId" value="" placeholder="请输入印章名称">
			                        </div>
			                    </div>
			                    <div class="layui-inline">
			                        <label class="layui-form-label width60">状态</label>
			                        <div class="layui-input-block width150">
			                            <select name="interest" lay-filter="aihao">
			                                <option value="0" selected="">待绑定</option>
			                                <option value="1">使用中</option>
			                                <option value="2" >已过期</option>
			                            </select>
			                        </div>
			                    </div>
					          <button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i>搜索</button>
					        </form>
					    </div>
                        <table class="layui-table mytable" lay-even="" lay-skin="nob">
                            <thead>
	                            <tr>
	                                <th>姓名</th>
	                                <th>部门</th>
	                                <th>职位</th>
	                                <th>外带印章</th>
	                                <th>外带设备</th>
	                                <th>申请时间</th>
	                                <th>领取时间</th>
	                                <th>归还时间</th>
	                                <th>当前状态</th>
	                                <th>操作</th>
	                            </tr>
                            </thead>
                            <tbody>
                            	<#list pm.datas as item>
	                            <tr>
	                                <td>${item.person.name}</td>
	                                <td></td>
	                                <td>${item.person.position}</td>
	                                <td>${item.seal.sealName}</td>
	                                <td>
	                                	<#if item.devices??>
	                                		${item.devices.alias}
	                                	</#if>
	                                </td>
	                                <td>${item.apply.applyTime?string("yyyy-MM-dd HH:mm:ss")}</td>
	                                <td>
	                                	<#if item.takeTime??>
	                                		${item.takeTime?string("yyyy-MM-dd HH:mm:ss")}
	                                	</#if>
	                                </td>
	                                <td>
	                                	<#if item.returnTime??>
	                                		${item.returnTime?string("yyyy-MM-dd HH:mm:ss")}
	                                	</#if>
	                                </td>
	                                <td>
	                                	<@linkage type="TAKE_STATUS" key=item.takeStatus>
							        		<span class="${linkage.style}">${linkage.name}</span>
							        	</@linkage>
	                                </td>
	                                <td>
	                                	<#if item.takeStatus=="PENDING">
	                                	<a href="javascript:openwinx('领取设备','/custos/take/receive.htm?devicesTakeId=${item.devicesTakeId}&sealId=${item.sealId}',600,400);">领取</a> | 
	                                	</#if>
	                                	
	                                	<#if item.takeStatus=="WAIT_RETURN">
	                                	<a href="javascript:openwinx('归还设备','/custos/take/return.htm?devicesTakeId=${item.devicesTakeId}&sealId=${item.sealId}&devicesId=${item.devicesId}',600,400);">归还</a> | 
	                                	</#if>
	                                	<a href="javascript:openwinx('记录详情','/custos/takeInfo.htm?devicesTakeId=${item.devicesTakeId}',800,400);">详情</a>
	                                
	                                </td>
	                            </tr>
	                            </#list>
                            </tbody>
                        </table>
                        <@p.page pm=pm></@p.page>
                    </div>
                    
                </div>
            </div>
        </div>
     </div>
<script>
layui.use(['element','laydate'], function(){
	  var $ = layui.jquery,element = layui.element,laydate = layui.laydate; 
	  element.on('tab(docDemoTabBrief)', function(elem){
	  		var id = $(this).attr('lay-id');
	  		if(id == 'SEAL_LIST'){
	  		 	location.href='/custos/list.htm';
	  		}
	  		if(id == 'APPLY_LIST'){
	  		 	location.href='/custos/applyList.htm';
	  		}
	  		if(id == 'APPROVE_LIST'){
	  		 	location.href='/custos/approveList.htm';
	  		}
	  		
	  });
});
</script>
</body>
</html>